package com.neusoft.dibuy.myarray;

import java.util.Arrays;

public class InsertSort {
    public static void main(String[] args) {
        int[] is = { 7,9,6,2,5,1,0,3,8,4 };
        for (int i = 1; i < is.length ; i++) {
            int  j =  i ;
            while ( j > 0 && is[j] < is[j-1]){
                int temp = is[j];
                is[j] = is[j-1];
                is[j-1] = temp;
                j--;
            }
        }
        System.out.println(Arrays.toString(is));
    }
}
